Vue.config.devtools = true;
var v = new Vue({
    el:"#app",
    data:{
        course: {
            title: "课程标题",
            coverImg:"../images/coverImg.png",
            vodUrl:"https://bnmy-video.oss-cn-beijing.aliyuncs.com/video/20251028144315.mp4",
        },
        playStatus: false,
        registerShow: false,
        isLogin: localStorage.getItem('isLogin') || 0,
        subForm: {
            memNickname: "",
            unitName: "",
            memMobile: "",
            position: "",
            title: "",
        },
    },
    created:function (){
        // if(!checkLogin()){
        //     toLogin();
        //     return false
        // }
        // initRightBtn(false,true,false,true);
        // this.findConferInfo();
    },
    methods:{
        play() {
            if (checkLogin()){
                this.playStatus = true
            } else {
                this.registerShow = true
            }
        },
        subRegisterData() {
            if (!this.checkRegisterData()){
                return false
            }
            request.post("/api/api/login/mobileLogin",true,JSON.stringify(this.subForm),"application/json").then(res => {
                if (res.code == 200) {
                    localStorage.setItem('memberInfo', JSON.stringify(res.data));
                    this.playStatus = true
                    this.registerShow = false
                    this.subForm = {
                        memNickname: "",
                        unitName: "",
                        memMobile: "",
                        position: "",
                        title: "",
                    }
                } else {
                    Toast(res.msg,1000)
                }
            })

        },
        checkRegisterData() {
            if (this.subForm.memNickname == ""){
                Toast("请输入姓名",1000)
                return false
            }
            if (this.subForm.unitName == ""){
                Toast("请输入单位名称",1000)
                return false
            }
            if (this.subForm.memMobile == ""){
                Toast("请输入手机号",1000)
                return false
            }
            if (this.subForm.position == ""){
                Toast("请输入职务",1000)
                return false
            }
            if (this.subForm.title == ""){
                Toast("请输入职称",1000)
                return false
            }
            return true
        }
    }
})
